<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class MY_Loader extends CI_Loader{
	
	public static function authload($p_class = null)
	{
		if ($p_class == null)
		{
			return false;
		}
	
		if ($p_class == 'self')
		{
			return true;
		}
	
		$arrParts = explode('_', $p_class);
	
		$pre = $arrParts[0];
	
		$path = null;
		if (in_array($pre, array('config')))
		{
			$path = APPPATH.$pre.'/';
		}
		else
		{
			return false;
		}
	
		foreach ($arrParts as $k => $v)
		{
			if ($k > 0)
			{
				$path .= $v.'/';
			}
		}
		
		$path = substr($path, 0,strlen($path)-1);
	
		$path .= EXT;
	
		if (file_exists($path))
		{
			require_once($path);
		}
	}
}

